class Solution {
public:
    vector<vector<int>> vv;

    vector<vector<int>> subsets(vector<int>& nums) {
        vector<int> v;
        cal(nums,v,0);
          
        return vv;     
    }
    
    void cal(vector<int>& nums,vector<int> v, int i)
    {
        if(i == nums.size())
        {
            vv.push_back(v);
            return;
        }
        
        cal(nums,v,i+1);
        v.push_back(nums[i]);
        cal(nums,v,i+1);
    }
};

class Solution {
public:
    vector<vector<int>> vv;

    vector<vector<int>> subsets(vector<int>& nums) {
        vector<int> v;
        vv.push_back(v);
        cal(nums,v,0);
          
        return vv;     
    }
    
    void cal(vector<int>& nums,vector<int> v, int i)
    {
        if(i == nums.size())
        {
            return;
        }
        
        for(int j=i; j<nums.size();j++)
        {
            v.push_back(nums[j]);
            vv.push_back(v);
            cal(nums,v,j+1);
            v.pop_back();
        }
        
        
    }
};